package com.furcas.javaee6.rainbow;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
@LocalBean
public class UserBean {

	@PersistenceContext(unitName = "rainbowPUT")
	private EntityManager em;

	public User findUserById(String id) {
		return em.find(User.class, id);
	}

	public User createUser(User user) {
		em.persist(user);
		return user;
	}
}
